<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        console.log(window.location)
    </script>
    <button onclick="gotoPage()">跳转到百度</button>
    <button onclick="refresh()">刷新</button>
    <script>
        // console.log(window.location)
        function gotoPage() {
            // 跳转到某个页面
            // window.location = 'http://www.baidu.com'
            // location.href='http://www.baidu.com'
            // location='http://www.baidu.com'

            // 替换当前页面
            // location.replace('http://www.baidu.com')
        }


        function refresh() {
            location.reload()
        }
    </script>
</body>

</html>